aboutsummaryrefslogtreecommitdiffstats
path: root/code/app/src/routes/(main)/(public)/reset-password/[id]/+page.server.ts
blob: 22fa29d9d73d72d5e179263a57df0dffe21b0eb3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
import { is_guid } from "$utilities/validators";
import { redirect } from "@sveltejs/kit";
import type { PageServerLoad } from "./$types";

export const load: PageServerLoad = async ({ params }) => {
    const resetRequestId = params.id ?? "";
    if (!is_guid(resetRequestId)) throw redirect(302, "/reset-password");
    return {
        resetRequestId,
    };
};